package com.easylinkin.linkappapi.grid.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.easylinkin.linkappapi.grid.entity.GridReportWeek;
import com.easylinkin.linkappapi.grid.models.query.GridReportWeekQuery;
import com.easylinkin.linkappapi.grid.models.vo.GridReportWeekInfoVO;
import com.easylinkin.linkappapi.grid.models.vo.GridReportWeekListVO;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 网格周报表 Mapper 接口
 *
 * @author kuyujie
 * @since 2024-05-17
 */
public interface GridReportWeekMapper extends BaseMapper<GridReportWeek> {
    /**
     * page
     *
     * @param page
     * @param query
     * @return IPage<GridReportWeekListVO>
     * @author kyj
     * @date 2024/5/16 18:36
     */
    IPage<GridReportWeekListVO> pageList(@Param("page") IPage<?> page, @Param("query") GridReportWeekQuery query);

    /**
     * list
     *
     * @param query
     * @return List<GridReportWeekListVO>
     * @author kyj
     * @date 2024/5/29 19:35
     */
    List<GridReportWeekListVO> listByQuery(@Param("query") GridReportWeekQuery query);

    /**
     * 获取详情
     *
     * @param id
     * @return GridReportWeekInfoVO
     * @author kyj
     * @date 2024/5/17 19:05
     */
    GridReportWeekInfoVO selectInfoById(@Param("id") Long id);

    /**
     * 周报设置每周只能设置一个
     *
     * @param tenantId
     * @param submitDeadline
     * @return int
     * @author kyj
     * @date 2024/5/27 13:49
     */
    int existByDate(@Param("tenantId") String tenantId, @Param("submitDeadline") LocalDateTime submitDeadline);
}